<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            position: relative;
            margin: 100px auto;
            text-align: center;
        }
        
        a {
            text-decoration: none;
        }
        
        i {
            position: absolute;
            top: -4px;
            right: 150px;
            width: 19px;
            text-align: center;
            background-color: #ccc;
        }
    </style>
</head>

<body>
    <div>
        <img src="images/adv1.webp" alt="">
        <a href="#">
            <i>×</i>
        </a>
    </div>
    <script>
        var btn = document.querySelector('a')
        var box = document.querySelector('div')
        btn.onclick = function() {
            box.style.display = 'none'
        }
    </script>
</body>

</html>